// 双指针
var deleteNode = function (head, val) {
  if (head.val == val) return head.next;
  let pre = head, 
      cur = haed.next;
  // 遍历
  while(cur != null && cur.val != val) {
    pre = cur;
    cur = cur.next;
  }
  // 定位结点并删除结点
  if (cur != null) pre.next = cur.next;
  return head;
}